﻿using DingTalk.Core;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DingTalk.Corp.Message.Models
{
    /// <summary>
    /// 
    /// </summary>
    public class UpdateMessageRequest
    {
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("agent_id")]
        public long AgentID 
        { 
            get; set; 
        }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("task_id")]
        public string TaskID
        {
            get; set;
        }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("status_value")]
        public string StatusValue
        {
            get; set;
        }
        string _status_bg;
        /// <summary>
        /// 6位颜色值(不区别大小写，小写自动转大写)，例：78C06E
        /// </summary>
        [JsonProperty("status_bg")]
        public string StatusBgColor
        {
            get
            {
                return _status_bg;
            }
            set
            {
                if (string.IsNullOrEmpty(value))
                    throw new ArgumentNullException("value");
                _status_bg = $"{ApiGlobalKey.COLOR_PREFIX}{value.ToUpper()}";
            }
        }
    }
}
